package util;

public class IDGenerator {
    private static int userCount = 0;
    private static int movieCount = 0;
    private static int hallCount = 0;
    private static int scheduleCount = 0;
    private static int ticketCount = 0;

    public static synchronized String generateUserId() {
        userCount++;
        return "U" + String.format("%06d", userCount);
    }

    public static synchronized String generateMovieId() {
        movieCount++;
        return "M" + String.format("%06d", movieCount);
    }

    public static synchronized String generateHallId() {
        hallCount++;
        return "H" + String.format("%06d", hallCount);
    }

    public static synchronized String generateScheduleId() {
        scheduleCount++;
        return "S" + String.format("%06d", scheduleCount);
    }

    public static synchronized String generateTicketId() {
        ticketCount++;
        return "T" + String.format("%06d", ticketCount);
    }
}